package com.ruoyi.project.treat.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.web.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

/**
 * 病历表 treat_patient_history
 *
 * @author ruoyi
 */
public class TreatPatientHistory extends BaseEntity {
    /*病历id*/
    private Integer historyId;
    /*病例编号*/
    private String historyNumber;
    /*接诊类型（0,初诊,1复诊）*/
    private String historyType;
    /*病人描述(主诉)*/
    private String historyDiscribe;
    /*发病日期*/
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date historyDate;
    /*诊断信息*/
    private String historyDiagnosis;
    /*是否是传染病(0,不传染,1传染)*/
    private String historyContagion;
    /*医生建议*/
    private String historyProposal;
    /*医生加的备注*/
    private String historyRemark;
    /*患者id（外键）*/
    private Long historyPatientId;

    /*患者属性*/
    private TreatPatient treatPatient;

    public TreatPatientHistory() {
    }

    public TreatPatientHistory(Integer historyId, String historyNumber, String historyType, String historyDiscribe, Date historyDate, String historyDiagnosis, String historyContagion, String historyProposal, String historyRemark, Long historyPatientId, TreatPatient treatPatient) {
        this.historyId = historyId;
        this.historyNumber = historyNumber;
        this.historyType = historyType;
        this.historyDiscribe = historyDiscribe;
        this.historyDate = historyDate;
        this.historyDiagnosis = historyDiagnosis;
        this.historyContagion = historyContagion;
        this.historyProposal = historyProposal;
        this.historyRemark = historyRemark;
        this.historyPatientId = historyPatientId;
        this.treatPatient = treatPatient;
    }

    public Integer getHistoryId() {
        return historyId;
    }

    public void setHistoryId(Integer historyId) {
        this.historyId = historyId;
    }

    public String getHistoryNumber() {
        return historyNumber;
    }

    public void setHistoryNumber(String historyNumber) {
        this.historyNumber = historyNumber;
    }

    public String getHistoryType() {
        return historyType;
    }

    public void setHistoryType(String historyType) {
        this.historyType = historyType;
    }

    public String getHistoryDiscribe() {
        return historyDiscribe;
    }

    public void setHistoryDiscribe(String historyDiscribe) {
        this.historyDiscribe = historyDiscribe;
    }

    public Date getHistoryDate() {
        return historyDate;
    }

    public void setHistoryDate(Date historyDate) {
        this.historyDate = historyDate;
    }

    public String getHistoryDiagnosis() {
        return historyDiagnosis;
    }

    public void setHistoryDiagnosis(String historyDiagnosis) {
        this.historyDiagnosis = historyDiagnosis;
    }

    public String getHistoryContagion() {
        return historyContagion;
    }

    public void setHistoryContagion(String historyContagion) {
        this.historyContagion = historyContagion;
    }

    public String getHistoryProposal() {
        return historyProposal;
    }

    public void setHistoryProposal(String historyProposal) {
        this.historyProposal = historyProposal;
    }

    public String getHistoryRemark() {
        return historyRemark;
    }

    public void setHistoryRemark(String historyRemark) {
        this.historyRemark = historyRemark;
    }

    public Long getHistoryPatientId() {
        return historyPatientId;
    }

    public void setHistoryPatientId(Long historyPatientId) {
        this.historyPatientId = historyPatientId;
    }

    public TreatPatient getTreatPatient() {
        return treatPatient;
    }

    public void setTreatPatient(TreatPatient treatPatient) {
        this.treatPatient = treatPatient;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TreatPatientHistory that = (TreatPatientHistory) o;
        return Objects.equals(historyId, that.historyId) &&
                Objects.equals(historyNumber, that.historyNumber) &&
                Objects.equals(historyType, that.historyType) &&
                Objects.equals(historyDiscribe, that.historyDiscribe) &&
                Objects.equals(historyDate, that.historyDate) &&
                Objects.equals(historyDiagnosis, that.historyDiagnosis) &&
                Objects.equals(historyContagion, that.historyContagion) &&
                Objects.equals(historyProposal, that.historyProposal) &&
                Objects.equals(historyRemark, that.historyRemark) &&
                Objects.equals(historyPatientId, that.historyPatientId) &&
                Objects.equals(treatPatient, that.treatPatient);
    }

    @Override
    public int hashCode() {
        return Objects.hash(historyId, historyNumber, historyType, historyDiscribe, historyDate, historyDiagnosis, historyContagion, historyProposal, historyRemark, historyPatientId, treatPatient);
    }

    @Override
    public String toString() {
        return "TreatPatientHistory{" +
                "historyId=" + historyId +
                ", historyNumber='" + historyNumber + '\'' +
                ", historyType='" + historyType + '\'' +
                ", historyDiscribe='" + historyDiscribe + '\'' +
                ", historyDate=" + historyDate +
                ", historyDiagnosis='" + historyDiagnosis + '\'' +
                ", historyContagion='" + historyContagion + '\'' +
                ", historyProposal='" + historyProposal + '\'' +
                ", historyRemark='" + historyRemark + '\'' +
                ", historyPatientId=" + historyPatientId +
                ", treatPatient=" + treatPatient +
                '}';
    }
}
